#Save for Shiny App
html_list <- list()

html_list[[1]] <- htmlreg(list(model_GAM_Subcountry_DemImportant$fitCountry[[1]], model_GAM_Subcountry_DemImportant$fitCountry[[2]], model_GAM_Subcountry_DemImportant$fitCountry[[3]], model_GAM_Subcountry_DemImportant$fitCountry[[4]], model_GAM_Subcountry_DemImportant$fitCountry[[5]], model_GAM_Subcountry_DemImportant$fitCountry[[6]], model_GAM_Subcountry_DemImportant$fitCountry[[7]], model_GAM_Subcountry_DemImportant$fitCountry[[8]], model_GAM_Subcountry_DemImportant$fitCountry[[9]], model_GAM_Subcountry_DemImportant$fitCountry[[10]], model_GAM_Subcountry_DemImportant$fitCountry[[11]], model_GAM_Subcountry_DemImportant$fitCountry[[12]], model_GAM_Subcountry_DemImportant$fitCountry[[13]], model_GAM_Subcountry_DemImportant$fitCountry[[14]], model_GAM_Subcountry_DemImportant$fitCountry[[15]], model_GAM_Subcountry_DemImportant$fitCountry[[16]]), custom.model.names = c(as.character(model_GAM_Subcountry_DemImportant$country[1:16])), custom.coef.map = list("age_grp1" = "Age group: 15-29", "age_grp2" = "Age group: 30-59", "waves.fWVS5" = "2005-2009", "waves.fWVS6" = "2010-2014", "sex" = "Gender", "EDF: s(born_adult)" = "s(Year turned 18)", "(Intercept)" = "Intercept"), caption = "")

html_list[[2]] <- htmlreg(list(model_GAM_Subcountry_Essentials$fitCountry[[1]], model_GAM_Subcountry_Essentials$fitCountry[[2]], model_GAM_Subcountry_Essentials$fitCountry[[3]], model_GAM_Subcountry_Essentials$fitCountry[[4]], model_GAM_Subcountry_Essentials$fitCountry[[5]], model_GAM_Subcountry_Essentials$fitCountry[[6]], model_GAM_Subcountry_Essentials$fitCountry[[7]], model_GAM_Subcountry_Essentials$fitCountry[[8]], model_GAM_Subcountry_Essentials$fitCountry[[9]], model_GAM_Subcountry_Essentials$fitCountry[[10]], model_GAM_Subcountry_Essentials$fitCountry[[11]], model_GAM_Subcountry_Essentials$fitCountry[[12]], model_GAM_Subcountry_Essentials$fitCountry[[13]], model_GAM_Subcountry_Essentials$fitCountry[[14]], model_GAM_Subcountry_Essentials$fitCountry[[15]]), custom.model.names = c(as.character(model_GAM_Subcountry_Essentials$country[1:15])), custom.coef.map = list("age_grp1" = "Age group: 15-29", "age_grp2" = "Age group: 30-59", "waves.fWVS5" = "2005-2009", "waves.fWVS6" = "2010-2014", "sex" = "Gender", "EDF: s(born_adult)" = "s(Year turned 18)", "(Intercept)" = "Intercept"), caption = "")


html_list[[3]] <- htmlreg(list(model_GAM_Subcountry_Essentials$fitCountry[[16]], model_GAM_Subcountry_Essentials$fitCountry[[17]], model_GAM_Subcountry_Essentials$fitCountry[[18]], model_GAM_Subcountry_Essentials$fitCountry[[19]], model_GAM_Subcountry_Essentials$fitCountry[[20]], model_GAM_Subcountry_Essentials$fitCountry[[21]], model_GAM_Subcountry_Essentials$fitCountry[[22]], model_GAM_Subcountry_Essentials$fitCountry[[23]], model_GAM_Subcountry_Essentials$fitCountry[[24]], model_GAM_Subcountry_Essentials$fitCountry[[25]], model_GAM_Subcountry_Essentials$fitCountry[[26]], model_GAM_Subcountry_Essentials$fitCountry[[27]], model_GAM_Subcountry_Essentials$fitCountry[[28]], model_GAM_Subcountry_Essentials$fitCountry[[29]], model_GAM_Subcountry_Essentials$fitCountry[[30]]), custom.model.names = c(as.character(model_GAM_Subcountry_Essentials$country[16:30])), custom.coef.map = list("age_grp1" = "Age group: 15-29", "age_grp2" = "Age group: 30-59", "waves.fWVS5" = "2005-2009", "waves.fWVS6" = "2010-2014", "sex" = "Gender", "EDF: s(born_adult)" = "s(Year turned 18)", "(Intercept)" = "Intercept"), caption = "")

html_list[[4]] <- htmlreg(list(model_GAM_Subcountry_Essentials$fitCountry[[31]], model_GAM_Subcountry_Essentials$fitCountry[[32]], model_GAM_Subcountry_Essentials$fitCountry[[33]], model_GAM_Subcountry_Essentials$fitCountry[[34]], model_GAM_Subcountry_Essentials$fitCountry[[35]], model_GAM_Subcountry_Essentials$fitCountry[[36]], model_GAM_Subcountry_Essentials$fitCountry[[37]], model_GAM_Subcountry_Essentials$fitCountry[[38]], model_GAM_Subcountry_Essentials$fitCountry[[39]], model_GAM_Subcountry_Essentials$fitCountry[[40]], model_GAM_Subcountry_Essentials$fitCountry[[41]], model_GAM_Subcountry_Essentials$fitCountry[[42]], model_GAM_Subcountry_Essentials$fitCountry[[43]], model_GAM_Subcountry_Essentials$fitCountry[[44]], model_GAM_Subcountry_Essentials$fitCountry[[45]]), custom.model.names = c(as.character(model_GAM_Subcountry_Essentials$country[31:45])), custom.coef.map = list("age_grp1" = "Age group: 15-29", "age_grp2" = "Age group: 30-59", "waves.fWVS5" = "2005-2009", "waves.fWVS6" = "2010-2014", "sex" = "Gender", "EDF: s(born_adult)" = "s(Year turned 18)", "(Intercept)" = "Intercept"), caption = "")

html_list_GAM_Sub <- html_list

#Save for Shiny App
save(html_list_GAM_Sub, file = paste0(wdShinyData,"html_list_GAM_Sub.Rdata"))